/**
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package pies.chat.model;

import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.ModelWrapper;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * This class is a wrapper for {@link Device}.
 * </p>
 *
 * @author HoangAnh
 * @see Device
 * @generated
 */
public class DeviceWrapper implements Device, ModelWrapper<Device> {
	public DeviceWrapper(Device device) {
		_device = device;
	}

	@Override
	public Class<?> getModelClass() {
		return Device.class;
	}

	@Override
	public String getModelClassName() {
		return Device.class.getName();
	}

	@Override
	public Map<String, Object> getModelAttributes() {
		Map<String, Object> attributes = new HashMap<String, Object>();

		attributes.put("deviceId", getDeviceId());
		attributes.put("deviceToken", getDeviceToken());
		attributes.put("deviceName", getDeviceName());

		return attributes;
	}

	@Override
	public void setModelAttributes(Map<String, Object> attributes) {
		Long deviceId = (Long)attributes.get("deviceId");

		if (deviceId != null) {
			setDeviceId(deviceId);
		}

		String deviceToken = (String)attributes.get("deviceToken");

		if (deviceToken != null) {
			setDeviceToken(deviceToken);
		}

		String deviceName = (String)attributes.get("deviceName");

		if (deviceName != null) {
			setDeviceName(deviceName);
		}
	}

	/**
	* Returns the primary key of this device.
	*
	* @return the primary key of this device
	*/
	@Override
	public long getPrimaryKey() {
		return _device.getPrimaryKey();
	}

	/**
	* Sets the primary key of this device.
	*
	* @param primaryKey the primary key of this device
	*/
	@Override
	public void setPrimaryKey(long primaryKey) {
		_device.setPrimaryKey(primaryKey);
	}

	/**
	* Returns the device ID of this device.
	*
	* @return the device ID of this device
	*/
	@Override
	public long getDeviceId() {
		return _device.getDeviceId();
	}

	/**
	* Sets the device ID of this device.
	*
	* @param deviceId the device ID of this device
	*/
	@Override
	public void setDeviceId(long deviceId) {
		_device.setDeviceId(deviceId);
	}

	/**
	* Returns the device token of this device.
	*
	* @return the device token of this device
	*/
	@Override
	public java.lang.String getDeviceToken() {
		return _device.getDeviceToken();
	}

	/**
	* Sets the device token of this device.
	*
	* @param deviceToken the device token of this device
	*/
	@Override
	public void setDeviceToken(java.lang.String deviceToken) {
		_device.setDeviceToken(deviceToken);
	}

	/**
	* Returns the device name of this device.
	*
	* @return the device name of this device
	*/
	@Override
	public java.lang.String getDeviceName() {
		return _device.getDeviceName();
	}

	/**
	* Sets the device name of this device.
	*
	* @param deviceName the device name of this device
	*/
	@Override
	public void setDeviceName(java.lang.String deviceName) {
		_device.setDeviceName(deviceName);
	}

	@Override
	public boolean isNew() {
		return _device.isNew();
	}

	@Override
	public void setNew(boolean n) {
		_device.setNew(n);
	}

	@Override
	public boolean isCachedModel() {
		return _device.isCachedModel();
	}

	@Override
	public void setCachedModel(boolean cachedModel) {
		_device.setCachedModel(cachedModel);
	}

	@Override
	public boolean isEscapedModel() {
		return _device.isEscapedModel();
	}

	@Override
	public java.io.Serializable getPrimaryKeyObj() {
		return _device.getPrimaryKeyObj();
	}

	@Override
	public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
		_device.setPrimaryKeyObj(primaryKeyObj);
	}

	@Override
	public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
		return _device.getExpandoBridge();
	}

	@Override
	public void setExpandoBridgeAttributes(
		com.liferay.portal.model.BaseModel<?> baseModel) {
		_device.setExpandoBridgeAttributes(baseModel);
	}

	@Override
	public void setExpandoBridgeAttributes(
		com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
		_device.setExpandoBridgeAttributes(expandoBridge);
	}

	@Override
	public void setExpandoBridgeAttributes(
		com.liferay.portal.service.ServiceContext serviceContext) {
		_device.setExpandoBridgeAttributes(serviceContext);
	}

	@Override
	public java.lang.Object clone() {
		return new DeviceWrapper((Device)_device.clone());
	}

	@Override
	public int compareTo(pies.chat.model.Device device) {
		return _device.compareTo(device);
	}

	@Override
	public int hashCode() {
		return _device.hashCode();
	}

	@Override
	public com.liferay.portal.model.CacheModel<pies.chat.model.Device> toCacheModel() {
		return _device.toCacheModel();
	}

	@Override
	public pies.chat.model.Device toEscapedModel() {
		return new DeviceWrapper(_device.toEscapedModel());
	}

	@Override
	public pies.chat.model.Device toUnescapedModel() {
		return new DeviceWrapper(_device.toUnescapedModel());
	}

	@Override
	public java.lang.String toString() {
		return _device.toString();
	}

	@Override
	public java.lang.String toXmlString() {
		return _device.toXmlString();
	}

	@Override
	public void persist()
		throws com.liferay.portal.kernel.exception.SystemException {
		_device.persist();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}

		if (!(obj instanceof DeviceWrapper)) {
			return false;
		}

		DeviceWrapper deviceWrapper = (DeviceWrapper)obj;

		if (Validator.equals(_device, deviceWrapper._device)) {
			return true;
		}

		return false;
	}

	/**
	 * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
	 */
	public Device getWrappedDevice() {
		return _device;
	}

	@Override
	public Device getWrappedModel() {
		return _device;
	}

	@Override
	public void resetOriginalValues() {
		_device.resetOriginalValues();
	}

	private Device _device;
}